<template>
    <div class="dialog" id="dialog" v-show="isShowDialog">
        <p>兑换成功</p>
        <button v-on:click="hideDialog" ca="灌水活动_兑券成功$去确定">确定</button>
        <a v-on:click="forwardCouponListAction" ca="灌水活动_兑券成功$去券包查看">&nbsp;&nbsp;去券包查看》</a>
    </div>
</template>
<script>
    import common from "../../assets/js/common.js";
    export default{
        data: function () {
            return {
            	isShowDialog: false
            }
        },
        methods: {
        	showDialog: function () {
        		this.isShowDialog = true;
        	},
            hideDialog: function () {
            	//this.isShowDialog = false;
            	//this.$parent.$refs.cpnList.showQuanListPage();
            	//window.history.go(-1);
            	lb.closeWebview(function (data) {
				    //关闭Webview
				    lb.closeWebview(function (data) {
					    //关闭Webview
					});
				});
            },
            forwardCouponListAction: function (){
                var host = window.location.host;
                var cxjappHost = "";
		    	if (host.indexOf("sit") > -1) {
		    		cxjappHost = "//cxjapp.chexiangsit.com";
		    	}else if (host.indexOf("pre") > -1) {
		    		cxjappHost = "//cxjapp.chexiangpre.com";
		    	}else  {
		    		cxjappHost = "//cxjapp.chexiang.com";
		    	}
		    	window.location.href = cxjappHost+"/service/usercoupon/getUserCouponList/1?couponType=1&userId=";
            }
        }
    }
</script>
<style lang="scss">
    @import '../../assets/css/common.scss';
    /** {
        box-sizing: border-box;
    }
    body{
        background-color: red;
    }*/
    .dialog {
        padding: 4rem 0 1rem 0 !important;
        background-color: #fff;
        border-radius: .5rem;
        box-shadow: 0 .7rem 1rem 0 rgba(0,0,0,.2);
        text-align: center;
        position: fixed;
        left: 5%;
        top: 15rem;
        width: 90%;
        height: 28rem;
    }

    .dialog p {
        margin: auto;
        padding-top: 8.5rem;
        background: url("../../assets/image/qdgs/hongbao.png") center top no-repeat;
        background-size: 100% auto;
        font-size: 1.8rem;
        width: 40%;
    }

    .dialog button {
        margin: 3rem auto 0 auto;
        background: url("../../assets/image/qdgs/btn-bg.png") center no-repeat;
        background-size: auto;
        border: 0;
        border-radius: .5rem;
        text-align: center;
        font-size: 1.6rem;
        line-height: 3rem;
        color: #fff;
        width: 17rem;
        height: 3.5rem;
        display: block;
        outline: none;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }

    .dialog a {
        padding-top: .5rem;
        display: block;
        text-align: center;
        color: #0084ff;
        font-size: 1.6rem;
    }
</style>
